package com.cdn.cretry.anno;


import com.cdn.cretry.enums.DelayStrategyType;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 蔡定努
 * 2024/06/06 13:25
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CRetry {

    int maxRetries() default 3;

    /**
     * 延迟时间
     * delayStrategy 为 FIXED生效
     * @return long
     */
    long delay() default 5000;

    /**
     *  delayStrategy 为 EXPONENTIAL_BACKOFF生效
     * @return long
     */
    long multiplier() default 2;

    DelayStrategyType delayStrategy() default DelayStrategyType.FIXED;


}
